const compareArray = (arr1, arr2) => {
   arr1.sort();
   arr2.sort();
   const Equal = arr1.every((element, index) => {
      return element === arr2[index];
   });

   return Equal;
};

const formatFloat = (value) => parseFloat(value.toFixed(2));

const genCode = () => {
   let randomNumber = '';
   for (let i = 0; i < 6; i++) {
      // 生成0到9之间的随机整数，并转换为字符串
      const digit = Math.floor(Math.random() * 10);
      randomNumber += digit.toString();
   }
   return randomNumber;
};

module.exports = {
   compareArray,
   formatFloat,
   genCode
};
